class CommonException(Exception):
    def __init__(self, error_enum):
        self.code = error_enum.value['code']
        self.msg = error_enum.value['msg']
        self.error_enum = error_enum
        super().__init__()


class BusinessException(CommonException):
    """
    业务异常
    """
    pass


class ApiException(CommonException):
    """
    接口异常
    """
    pass
